﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using yq.IBase;
using yq.IBase.Basis;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using cn.Util;

namespace yq.Model.Logic
{
    ///<summary>
    /// Sys_Folder - 文件表 - 对象继承类
    /// </summary>
    [Table("Sys_Folder")]
    [MetadataType(typeof(SysFolderValidaTion))]
    public class SysFolder : ModelBase<SysFolder>
    {
        /// <summary>
        /// 为本对象赋值
        /// </summary>
        /// <param name="dy"></param>
        public override void SetValue(dynamic dy)
        {
            this.FolderId = dy.FolderId;
            this.Sid = dy.Sid;
            this.Num = dy.Num;
            this.IsHttp = dy.IsHttp;
            this.IsDel = dy.IsDel;
            this.CTime = dy.CTime;
            this.Version = dy.Version;
        } 


        /// <summary>
        /// 文件夹ID
        /// </summary>
        private String _FolderId = "";


        ///<summary>
        /// 文件夹ID
        ///</summary>
        [FromDb("FolderId", true)]
        public String FolderId
        {
            get
            {
                return (this._FolderId);
            }

            set
            {
                _FolderId = value;
            }
        }







        /// <summary>
        /// 服务ID
        /// </summary>
        private String _Sid = "";


        ///<summary>
        /// 服务ID
        ///</summary>
        [FromDb("Sid")]
        public String Sid
        {
            get
            {
                return (this._Sid);
            }

            set
            {
                _Sid = value;
            }
        }













        /// <summary>
        /// 文件数量
        /// </summary>
        private int _Num = int.MinValue;


        ///<summary>
        /// 文件数量
        ///</summary>
        [FromDb("Num")]
        public int Num
        {
            get
            {
                return (this._Num);
            }

            set
            {
                _Num = value;
            }
        }







        /// <summary>
        /// 是否通过HTTP访问
        /// </summary>
        private int _IsHttp = -1;


        ///<summary>
        /// 是否通过HTTP访问
        ///</summary>
        [FromDb("IsHttp")]
        public int __IsHttp
        {
            get
            {
                return (this._IsHttp);
            }
            set
            {
                _IsHttp = value;
            }
        }

        public yq.Enums.BooleanType IsHttp
        {
            get
            {
                return (yq.Enums.BooleanType)_IsHttp;
            }

            set
            {
                _IsHttp = value.GetHashCode();
            }
        }







        /// <summary>
        /// 是否删除
        /// </summary>
        private int _IsDel = -1;


        ///<summary>
        /// 是否删除
        ///</summary>
        [FromDb("IsDel")]
        public int __IsDel
        {
            get
            {
                return (this._IsDel);
            }
            set
            {
                _IsDel = value;
            }
        }

        public yq.Enums.BooleanType IsDel
        {
            get
            {
                return (yq.Enums.BooleanType)_IsDel;
            }

            set
            {
                _IsDel = value.GetHashCode();
            }
        }







        /// <summary>
        /// 创建时间
        /// </summary>
        private DateTime _CTime = DateTime.MinValue;


        ///<summary>
        /// 创建时间
        ///</summary>
        [FromDb("CTime")]
        public DateTime CTime
        {
            get
            {
                return (this._CTime);
            }

            set
            {
                _CTime = value;
            }
        }







        /// <summary>
        /// Version
        /// </summary>
        private String _Version = "";


        ///<summary>
        /// Version
        ///</summary>
        [FromDb("Version")]
        public String Version
        {
            get
            {
                return (this._Version);
            }

            set
            {
                _Version = value;
            }
        }






        ///<summary>
        /// 辅助验证类
        /// </summary>
        [Bind]
        public class SysFolderValidaTion
        {

            /// <summary>
            /// 文件夹ID
            /// </summary>
            [Display(Name = "文件夹ID")]
            [Required]
            [StringLength(36)]
            public String FolderId
            { get; set; }


            /// <summary>
            /// 服务ID
            /// </summary>
            [Display(Name = "服务ID")]
            [Required]
            [StringLength(36)]
            public String Sid
            { get; set; }



            /// <summary>
            /// 文件数量
            /// </summary>
            [Display(Name = "文件数量")]
            [RegularExpression(RegularExpressionString.Int, ErrorMessage = "必须输入数字")]
            public int Num
            { get; set; }


            /// <summary>
            /// 是否通过HTTP访问
            /// </summary>
            [Display(Name = "是否通过HTTP访问")]
            [Required]
            [RegularExpression(RegularExpressionString.Int, ErrorMessage = "必须输入数字")]
            public yq.Enums.BooleanType IsHttp
            { get; set; }


            /// <summary>
            /// 是否删除
            /// </summary>
            [Display(Name = "是否删除")]
            [Required]
            [RegularExpression(RegularExpressionString.Int, ErrorMessage = "必须输入数字")]
            public yq.Enums.BooleanType IsDel
            { get; set; }


            /// <summary>
            /// 创建时间
            /// </summary>
            [Display(Name = "创建时间")]
            [Required]
            public DateTime CTime
            { get; set; }

        }
    }
}